package com.mayikt.service.impl;

import com.mayikt.service.MemberService;
import com.mayikt.service.feign.WeiXinServiceFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Name MemberService
 * @Author 枫火
 * @Date 2021/3/30 21:59
 * @Description
 **/
@RestController
@RefreshScope
public class MemberServiceImpl implements MemberService {

    @Value("${mayikt.name}")
    private String name;

    @Autowired
    private WeiXinServiceFeign weiXinServiceFeign;

    @Override
    public String memberToWeiXin(Long userId) {
        return "会员服务调用：" + weiXinServiceFeign.appInfo(userId);
//        return (1 / userId) + "";
    }

    @GetMapping("/getConfig")
    public String getConfig() {
        return name;
    }
}
